/**
 * @author LKQ
 * @date 2022/2/13 13:45
 * @description
 */
public class Solution2 {
    public static void main(String[] args) {

    }
    public int maxNumberOfBalloons(String text) {
        int[] counts = new int[26];
        for (char c : text.toCharArray()) {
            counts[c - 'a']++;
        }
        int max = Math.min(counts[0], counts[1]);
        max = Math.min(max, counts['l' - 'a'] / 2);
        max = Math.min(max, counts['n' - 'a']);
        max = Math.min(max, counts['o' - 'a'] / 2);
        return max;
    }
}
